package com.gonsin.gview.example.dao;

import com.gonsin.gview.example.bean.UserBean;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户数据操作类
 */
@Repository
public interface UserDao extends JpaRepository<UserBean, Integer> {

    /**
     * 批量删除人员
     */
    @Query("delete UserBean m where m.userId in :userIds")
    @Modifying
    void deleteAllIn(@Param("userIds") List<Integer> userIds);
}
